package com.atguigu.gulimall.product.feign.fallback;

import com.atguigu.common.exception.BizCodeEnume;
import com.atguigu.common.utils.R;
import com.atguigu.gulimall.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 远程秒杀服务错误回调实现
 *
 * @author xiaoping
 * @create 2020/7/13 11:28
 * @since 1.0.0
 */
@Slf4j
@Component
public class SeckillFeignServiceFallBack implements SeckillFeignService {
    /**
     * 获取指定商品的秒杀信息
     *
     * @param skuId
     * @return
     */
    @Override
    public R getSkuSecKillInfo(Long skuId) {
        log.error("熔断方法调用...getSkuSecKillInfo");
        return R.error(BizCodeEnume.TOO_MANY_REQUEST.getCode(), BizCodeEnume.TOO_MANY_REQUEST.getMsg());
    }
}
